package jlib.component.panel
{
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.TimerEvent;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	import flash.utils.Timer;
	import flash.utils.setTimeout;
	
	import jlib.component.animation.Animation;
	import jlib.component.layout.LayoutGravity;
	import jlib.utils.ArrangeUtil;
	import jlib.utils.Clock;
	
	/**
	 * Frame.
	 * @author jjong
	 */	
	public class Frame extends Sprite
	{
		private var m_registration:Point;
		private var m_snapPoint:Point;
		
		public function Frame() {
			super();
		}
		
		/**
		 * 내부 Registration 설정해 지정 된 포인트에 Snap 시킨다. 
		 * @param $snapPoint Snap 될 위치.
		 * @param $registration 내부 Registration Point 
		 */	
		public function snap($snapPoint:Point, $registration:Point): void {
			m_snapPoint = $snapPoint;
			m_registration = $registration;
			var innerDisX:Number = m_registration.x - x;
			var innerDisY:Number = m_registration.y - y;
			var disX:Number = m_snapPoint.x - x;
			var disY:Number = m_snapPoint.y - y;
			x = disX - innerDisX;
			y = disY - innerDisY;
		}
		
		public function show($animation:Animation): void {
			$animation.start();
		}
		
		public function hide($animation:Animation): void {
			$animation.start();
		}
	
	}//c
}